import { lazy } from "react";
import Home from "../views/Home";

const routers=[{
    path:'/home',
    component:Home,
    children:[{
        path:'/home/homepage',
        component:lazy(()=>import('../views/home/Homepage')),
        title:'首页'
    },{
        path:'/home/classify',
        component:lazy(()=>import('../views/home/Classify')),
        title:'分类'
    },{
        path:'/home/shopcar',
        component:lazy(()=>import('../views/home/Shopcar')),
        title:'购物车'
    },{
        path:'/home/my',
        component:lazy(()=>import('../views/home/My')),
        title:'我的'
    },]
},{
    path:'/login',
    component:lazy(()=>import('../views/Login'))
},{
    path:'/soshuo',
    component:lazy(()=>import('../views/Soshuo'))
},{
    path:'/xiang/:id',
    component:lazy(()=>import('../views/Xiang'))
},{
    path:'/',
    redirect: '/home/homepage',  // 重定向:重新指向其它path,会改变网址
}
]
export default routers